/**
 * Copyright 2009-2011 xiaonei.com All right reserved.
 * This software is the confidential and proprietary information of Xiaonei.com ("Confidential Information"). 
 * You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the license agreement you entered into with Xiaonei.com.
 * Create by XiaoNeiAntiSpamTeam
 *
 */

package com.xiaonei.test.reflect;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: ClassLoadUtil
 * @Description: TODO
 * @author shaohui.liu shaohui.liu@opi-corp.com
 * @date Mar 24, 2010 10:53:37 AM
 * 
 */
public class ClassLoadUtil {

    public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException,
            SecurityException, InstantiationException, IllegalAccessException,
            InvocationTargetException, NoSuchMethodException {
        String className = "com.xiaonei.test.reflect.Demo";
        Class T = Class.forName(className);
        Demo demo = (Demo) T.getConstructor(int.class).newInstance(1);

        demo = (Demo) T.getConstructor(String.class).newInstance("123");
        List<Integer> intList = new ArrayList<Integer>();
        intList.add(1);
        demo = (Demo) T.getConstructor(List.class).newInstance(intList);
        
        demo = (Demo) T.getConstructor(List.class,String.class).newInstance(intList,"13134");
    }
}
